import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from "typeorm";
import { Book } from "./book.entity";

@Entity()
export class Category {
  @PrimaryGeneratedColumn()
  id: number;

  // 分类名
  @Column()
  name: string;

  @OneToMany(() => Book, (book) => book.category)
  book: Book[];
}
